Skip to content

Conversation

@champtar
Copy link
Contributor

@champtar champtar commented Jun 4, 2025

When we don't install the documentation, rpm-ostree (rpm works fine) still install empty directories, leading to lint failures.

Fixes #1351

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to fix lint failures caused by empty documentation directories in the RPM package. The approach involves explicitly listing only files (not directories) for packaging from the documentation directory, and ensuring a specific problematic directory contains a .keepdir file. The changes look good and effectively address the described issue.

Summary of Findings

  • RPM Spec: Path formatting in find command: In contrib/packaging/bootc.spec at line 126, the find command uses -printf '/%{_docdir}/%%P\n'. Since %{_docdir} (e.g., /usr/share/doc/bootc) already starts with a /, this results in paths in bootcdoclist.txt starting with // (e.g., //usr/share/doc/bootc/somefile.txt). While most systems normalize this, using -printf '%{_docdir}/%%P\n' would produce cleaner paths (e.g., /usr/share/doc/bootc/somefile.txt). This is a low-severity stylistic improvement and a review comment was not added due to the project's review settings for comment severity.

Merge Readiness

The changes are well-implemented and address the problem described in the pull request. The code appears ready for merging. As a reviewer, I am not authorized to approve the pull request, so please ensure it undergoes any further required review and approval processes.

@champtar
Copy link
Contributor Author

champtar commented Jun 4, 2025

Before the change

/usr/share/doc/bootc 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/README.md 2972 1748970798 d9a2083c533134d6451e72bd7d88953268e81cf9178eaa7a5aa6c5e703991792 0100644 root root 0 1 0 X
/usr/share/doc/bootc/baseimage 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/base 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/base/ostree 14 1748995200 0000000000000000000000000000000000000000000000000000000000000000 0120777 root root 0 1 0 sysroot/ostree
/usr/share/doc/bootc/baseimage/base/sysroot 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/base/usr 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/base/usr/lib 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/base/usr/lib/ostree 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/base/usr/lib/ostree/prepare-root.conf 27 1748995200 3c0b9c5c9562a08e1f841d1b135afd8627d23e2984398b96fd73e112f917f1cc 0100644 root root 0 1 0 X
/usr/share/doc/bootc/baseimage/dracut 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/dracut/usr 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/dracut/usr/lib 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/dracut/usr/lib/dracut.conf.d 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/dracut/usr/lib/dracut.conf.d/10-bootc-base.conf 279 1748995200 d7bbd49408b7f84dac076aef20c2fd4a58f9df024eba9ce2e80521a708ee8448 0100644 root root 0 1 0 X
/usr/share/doc/bootc/baseimage/systemd 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/systemd/usr 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/systemd/usr/lib 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/systemd/usr/lib/kernel 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/baseimage/systemd/usr/lib/kernel/install.conf 222 1748995200 0527285144b8003d09ad444ffba25291fd24189fad4e7c8d10dd27b43475be28 0100644 root root 0 1 0 X

After the change

/usr/share/doc/bootc 0 1748995200 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X
/usr/share/doc/bootc/README.md 2972 1748995200 d9a2083c533134d6451e72bd7d88953268e81cf9178eaa7a5aa6c5e703991792 0100644 root root 0 1 0 X
/usr/share/doc/bootc/baseimage/base/ostree 14 1748995200 0000000000000000000000000000000000000000000000000000000000000000 0120777 root root 0 1 0 sysroot/ostree
/usr/share/doc/bootc/baseimage/base/sysroot/.keepdir 0 1748995200 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0100644 root root 0 1 0 X
/usr/share/doc/bootc/baseimage/base/usr/lib/ostree/prepare-root.conf 27 1748995200 3c0b9c5c9562a08e1f841d1b135afd8627d23e2984398b96fd73e112f917f1cc 0100644 root root 0 1 0 X
/usr/share/doc/bootc/baseimage/dracut/usr/lib/dracut.conf.d/10-bootc-base.conf 279 1748995200 d7bbd49408b7f84dac076aef20c2fd4a58f9df024eba9ce2e80521a708ee8448 0100644 root root 0 1 0 X
/usr/share/doc/bootc/baseimage/systemd/usr/lib/kernel/install.conf 222 1748995200 0527285144b8003d09ad444ffba25291fd24189fad4e7c8d10dd27b43475be28 0100644 root root 0 1 0 X

@champtar champtar force-pushed the spec-doc-no-dir branch 2 times, most recently from f9851cd to bc78a1c Compare June 4, 2025 13:41
When we don't install the documentation, rpm still install
empty directories, leading to lint failures.
@cgwalters cgwalters merged commit 19a8527 into bootc-dev:main Jun 11, 2025
34 checks passed
@champtar champtar deleted the spec-doc-no-dir branch June 12, 2025 08:49
@cgwalters
Copy link
Collaborator

For the record I think anyone affected by this with earlier bootc versions can work around this by just doing rm -rf /usr/share/doc/bootc in their image builds.

@champtar
Copy link
Contributor Author

champtar commented Jul 8, 2025

I confirm (that's what we do)

@jlebon
Copy link
Contributor

jlebon commented Jul 10, 2025

For the record I think anyone affected by this with earlier bootc versions can work around this by just doing rm -rf /usr/share/doc/bootc in their image builds.

Worth noting though for anyone using the bootc-base-imagectl build-rootfs flow that this is not possible since it combines both the rpm-ostree compose and bootc linting in one shot.

The hack I went with is coreos/fedora-coreos-config#3589.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

baseimage-root: Missing ostree -> sysroot/ostree link for images without documentation

3 participants